import feedparser

def weather(location):
	location = location.replace(" ","%20")
	feed = feedparser.parse("http://rss.accuweather.com/rss/liveweather_rss.asp?locCode=%s"%location)
	
	current = feed['entries'][0]['summary_detail']['value']
	current = current.split("\n")
	currently = current[0].encode("utf-8")
	test = currently.rsplit(" ")
	#currently = currently.replace("xb0", "")
	#print currently

	if test[0] == "To":
		result = "Forecast: Location not known"
	else:
		fc1date = feed['entries'][1]['title']
		fc1 = feed['entries'][1]['summary_detail']['value']
		fc1 = fc1.split("<")
		fc1 = fc1[0].encode("utf-8")
	
		fc2date = feed['entries'][2]['title']
		fc2 = feed['entries'][2]['summary_detail']['value']
		fc2 = fc2.split("<")
		fc2 = fc2[0].encode("utf-8")
	
		result = "%s %s" % (fc1date,fc1)
		result2 = "%s %s" % (fc2date,fc2) 
		return result,result2

